package Thread;
//工厂设计模式
//核心：通过静态方法，把构造对象new的过程各种属性初始化的过程，封装起来了
class Point{
    public static Point makePointByxy(double x,double y){
        Point p=new Point();
        //通过x和y给p进行属性上设置
        return p;
    }
    public static Point makePointByRA(double r,double a){
        Point p=new Point();
        //通过r和a给p进行属性上设置
        return p;
    }
}
public class Dom31 {
    public static void main(String[] args) {
        Point p1=Point.makePointByxy(10,20);
        Point p2=Point.makePointByRA(10,20);
    }
}
